<template>
	<view>
		<view class="bg">
			<!-- <image src="../../static/yz3.png" class="bg_img"></image> -->
			<view class="tab">
				<u-tabs :list="list1" @change="click" class="tabs" :activeStyle="{color:'#333333'}"
					:inactiveStyle="{color:'#999999'}"></u-tabs>
			</view>
		</view>
		<view v-if="this.num ==0">
			<view v-for="(item, index) in circleList" :key="index">
				<view class="head" @click="addDiscuss(item.id)">
					<view class="headtxt_fx">
						<view class="headtxt">{{item.title}}</view>
						<!-- <view>
							<span class="more_txt1">公开</span>
							<span class="more_txt" @click="gomore">···</span>
						</view> -->
					</view>
					<view class="nrtxt">{{item.content}}</view>
					<view>
						<image v-for="(item1,index) in item.pigList" :src="item1" class="con_tu"></image>
					</view>
					<view class="flx2">
						<view class="smtxt1">{{item.diffTime}}</view>
						<!-- <view class="imgtb">
							<image src="../../../static/s66.png" class="tb"></image>
							<text class="smtxt">111111</text>
						</view> -->
						<view @click="addLikes(item.id)">
							<image src="../../../static/yyz.png" class="tb"></image>
							<text class="smtxt">{{item.likesCount}}</text>
						</view>
						<view @click="addDiscuss(item.id)">
							<image src="../../../static/ltss.png" class="tb"></image>
							<text class="smtxt">{{item.discussCount}}</text>
						</view>
					</view>
				</view>
				<!-- <view class="line"></view> -->
			</view>
		</view>
		<view v-if="this.num == 1">
			<view class="hf">
				<view class="hf_fx">
					<view class="hf_imgtxt">
						<image src="../../../static/yytx.png" class="hf_img"></image>
						<span class="hf_imgtxt">换手机</span>
					</view>
					<view @click="del">
						<image src="../../../static/chat4.png" class="hf_shan"></image>
					</view>
				</view>
				<view>
					<span>回复:</span>我才开始了解和学习AIGC。我自己就是从一个电脑小白，到现在AIGC已经融入了我的工作和生活。
				</view>
				<view class="sj">
					50分钟前
				</view>
				<view class="hf_btn">原贴：主标题</view>
			</view>
		</view>
		<!-- <view class="pos" @click="iss">
			<view>
				<image src="../../static/s55.png" class="ft"></image>
			</view>
		</view> -->
		<u-popup :show="show" @close="close">
			<view class="pop">
				<view class="pop_txt">设为公开</view>
				<view class="pop_txt" @click="show = false">删除</view>
				<view class="pop_txt" @click="show = false">取消</view>
			</view>
		</u-popup>
		<u-overlay :show="show1">
			<view class="warp">
				<view class="warp_box">
					<view class="warp_txt">
						<view class="warp_txt1">确定要删除回复吗？</view>
						<view class="warp_fx">
							<view class="warp_btn" @click="show1 = false">取消</view>
							<view class="warp_btn1" @click="show = false">确认</view>
						</view>
					</view>
				</view>
			</view>
		</u-overlay>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				show1: false,
				keyword: '',
				num: 0,
				circleList: [],
				list1: [{
					name: '主贴',
				}, {
					name: '回复',
				}],
				tabtt: [{
					txt: "实践活动1",
					txt1: "11大石街道雷克萨简单来说卡机的"
				}, {
					txt: "实践活动2",
					txt1: "22大石街道雷克萨简单来说卡机的"
				}, {
					txt: "实践活动3",
					txt1: "33大石街道雷克萨简单来说卡机的"
				}]
			}
		},
		onShow() {
			//首页获取圈子列表
			this.getCircleData();
		},
		methods: {
			getCircleData() {
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				var userData = uni.getStorageSync('userData');
				console.log('99999', userData)
				self._get('plus/circle/list', {
					userId2: userData.userId
				}, function(res) {
					let data = res.data;
					self.circleList = data.list;
					uni.hideLoading();
				})
			},
			addLikes(circleId) {
				console.log('addLikes');
				let self = this;
				uni.showLoading({
					title: '加载中'
				});
				self._postBody('plus/circle/addLikes', {
					circleId: circleId
				}, function(res) {
					uni.hideLoading();
					self.getCircleData();
				});
			},
			addDiscuss(circleId) {
				uni.navigateTo({
					url: '/pages/universe/comment?circleId=' + circleId
				});
			},
			del() {
				this.show1 = true
			},
			close() {
				this.show = false
			},
			gomore() {
				this.show = true
			},
			click(item) {
				console.log('item', item, item.index);
				this.num = item.index
			},
			iss() {
				uni.navigateTo({
					url: '/pages/universe/issue'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: #FFFFFF;

	}

	.mgb-20 {
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
	}

	.bg {
		width: 750rpx;
		// height: 750rpx;
		// background-image: url('../../static/b1.png');
		// background-size: 100% 100%;
		margin-bottom: 17rpx;

		.bg_img {
			margin-top: 95rpx;
			margin-left: 30rpx;
			margin-bottom: 65rpx;
			width: 240rpx;
			height: 63rpx;
		}

		.tab {
			display: flex;
			justify-content: center;
		}

		.sea {
			margin-top: 28rpx;
			margin-left: 20rpx;
			margin-right: 20rpx;
		}

		.rw {
			margin-left: 20rpx;
			margin-right: 20rpx;

			.rw_img {
				width: 100%;
				height: 340rpx;
			}
		}
	}

	.tabicon {
		width: 110rpx;
		height: 110rpx;
		margin-right: 33rpx;

		.icon_img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.flx {
		// width: 100%;
		display: flex;
		align-items: center;
		margin-left: 40rpx;
		margin-right: 40rpx;
		padding-top: 46rpx;
	}

	.flx1 {
		display: flex;
	}

	.txt_fx1 {
		display: flex;
		justify-content: space-between;
		flex: 1;

		.btn {
			text-align: center;
			width: 77rpx;
			height: 22rpx;
			line-height: 22rpx;
			background: #0F4BCB;
			border-radius: 10rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #FFFFFF;
			padding: 9rpx;
			margin-left: 23rpx;
		}

		.txt {
			font-family: Source Han Sans CN;
			font-weight: 500;
			font-size: 32rpx;
			color: #000000;
		}
	}

	.sltxt {
		font-family: Source Han Sans CN;
		font-weight: 300;
		font-size: 24rpx;
		color: #999999;
		margin-right: 40rpx;
	}

	.shan {
		width: 20rpx;
		height: 20rpx;
	}

	.head {
		margin-left: 40rpx;
		margin-top: 54rpx;
		margin-right: 40rpx;
		padding-bottom: 52rpx;
		border-bottom: 1rpx solid #CCCCCC;
	}

	.headtxt_fx {
		display: flex;
		justify-content: space-between
	}

	.more_txt {
		vertical-align: top;
		color: #999999;
		font-size: 40rpx;
		line-height: 50rpx;
	}

	.more_txt1 {
		font-family: Source Han Sans CN;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 50rpx;
		padding-right: 23rpx;
	}

	.headtxt {
		margin-bottom: 30rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		font-size: 32rpx;
		color: #333333;
		line-height: 43rpx;
	}

	.nrtxt {
		font-family: Source Han Sans CN;
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
	}

	.nr_img {
		width: 230rpx;
		height: 280rpx;
		border: 1px solid red;
	}

	.tb {
		width: 30rpx;
		height: 30rpx;
		vertical-align: middle;
	}

	.flx2 {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 30rpx;
	}

	.imgtb {}

	.smtxt {
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
	}

	.smtxt1 {
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
	}

	.ft {
		width: 260rpx;
		height: 240rpx;
	}

	.pos {
		position: fixed;
		right: 0;
		bottom: 200rpx;
	}

	.search {
		height: 80rpx;
		line-height: 54rpx;
		background: #F5F5F5;
		border-radius: 54rpx 54rpx 54rpx 54rpx;
		display: flex;
		align-content: center;

		.sea_ipt {
			height: 80rpx;
		}

		image {
			width: 27rpx;
			height: 27rpx;
			margin: 14rpx 10rpx 14rpx 18rpx;
		}

		input {
			height: 54rpx;
			line-height: 54rpx;
			font-size: 22rpx;
			color: #999999;
			display: flex;
			flex: 1;
			margin-right: 30rpx;
			margin-left: 30rpx;
		}

		.btn {
			width: 140rpx;
			height: 80rpx;
			line-height: 80rpx;
			background: #0F4BCB;
			border-radius: 54rpx 54rpx 54rpx 54rpx;
			text-align: center;
			font-size: 29rpx;
			font-weight: 500;
			color: #FFFFFF;
		}
	}

	.pop {
		text-align: center;
		padding: 25rpx;

		.pop_txt {
			margin: 50rpx;
		}
	}

	.hf {
		width: 640rpx;
		// height: 420rpx;
		background: #F0F0F0;
		border-radius: 20rpx;
		padding: 25rpx;
		margin: 0 auto;

		.hf_fx {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 30rpx;
		}

		.hf_img {
			width: 80rpx;
			height: 80rpx;
			border-radius: 40rpx;
			margin-right: 26rpx;
		}

		.hf_imgtxt {
			display: flex;
			align-items: center;
			font-family: Source Han Sans CN;
			font-weight: 500;
			font-size: 30rpx;
			color: #000000;
			// vertical-align: middle;
		}

		.hf_shan {
			width: 40rpx;
			height: 40rpx;
		}

		.sj {
			margin-top: 30rpx;
			margin-bottom: 45rpx;
		}

		.hf_btn {
			width: 650rpx;
			height: 65rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			line-height: 65rpx;
			text-align: center;
		}
	}

	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;

		.warp_box {
			background-image: url('../../../static/kuang.png');
			background-size: 100% 100%;
			width: 650rpx;
			height: 350rpx;
		}

		.warp_txt {
			text-align: center;
			// line-height: 350rpx;
		}

		.warp_txt1 {
			font-family: Source Han Sans CN;
			font-weight: 300;
			font-size: 30rpx;
			color: #999999;
			margin-top: 110rpx;
			margin-bottom: 90rpx;
		}

		.warp_fx {
			display: flex;
			justify-content: center;
		}

		.warp_btn {
			width: 220rpx;
			height: 60rpx;
			background: #D3D3D3;
			border-radius: 30rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			font-size: 32rpx;
			color: #FFFFFF;
			line-height: 60rpx;
			margin-right: 60rpx;
		}

		.warp_btn1 {
			width: 220rpx;
			height: 60rpx;
			background: #2168EA;
			border-radius: 30rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			font-size: 32rpx;
			color: #FFFFFF;
			line-height: 60rpx;
		}
	}

	.con_tu {
		width: 200rpx;
		height: 280rpx;
		margin-top: 40rpx;
		margin-left: 10rpx;
	}
</style>